package com.iot.device.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.iot.device.mapper.BeidouEventMapper;
import com.iot.device.domain.BeidouEvent;
import com.iot.device.service.IBeidouEventService;

/**
 * 海岛北斗事件Service业务层处理
 * 
 * @author iot
 * @date 2023-05-10
 */
@Service
public class BeidouEventServiceImpl implements IBeidouEventService 
{
    @Autowired
    private BeidouEventMapper beidouEventMapper;

    /**
     * 查询海岛北斗事件
     * 
     * @param id 海岛北斗事件主键
     * @return 海岛北斗事件
     */
    @Override
    public BeidouEvent selectBeidouEventById(Long id)
    {
        return beidouEventMapper.selectBeidouEventById(id);
    }

    /**
     * 查询海岛北斗事件列表
     * 
     * @param beidouEvent 海岛北斗事件
     * @return 海岛北斗事件
     */
    @Override
    public List<BeidouEvent> selectBeidouEventList(BeidouEvent beidouEvent)
    {
        return beidouEventMapper.selectBeidouEventList(beidouEvent);
    }

    /**
     * 新增海岛北斗事件
     * 
     * @param beidouEvent 海岛北斗事件
     * @return 结果
     */
    @Override
    public int insertBeidouEvent(BeidouEvent beidouEvent)
    {
        return beidouEventMapper.insertBeidouEvent(beidouEvent);
    }

    /**
     * 修改海岛北斗事件
     * 
     * @param beidouEvent 海岛北斗事件
     * @return 结果
     */
    @Override
    public int updateBeidouEvent(BeidouEvent beidouEvent)
    {
        return beidouEventMapper.updateBeidouEvent(beidouEvent);
    }

    /**
     * 批量删除海岛北斗事件
     * 
     * @param ids 需要删除的海岛北斗事件主键
     * @return 结果
     */
    @Override
    public int deleteBeidouEventByIds(Long[] ids)
    {
        return beidouEventMapper.deleteBeidouEventByIds(ids);
    }

    /**
     * 删除海岛北斗事件信息
     * 
     * @param id 海岛北斗事件主键
     * @return 结果
     */
    @Override
    public int deleteBeidouEventById(Long id)
    {
        return beidouEventMapper.deleteBeidouEventById(id);
    }

    @Override
    public List<BeidouEvent> selectRecentBeidouEventList(Long userId, Long limit) {
        return beidouEventMapper.selectRecentBeidouEventList(userId, limit);
    }

    @Override
    public List<Map<String, Long>> selectBeidouEventRankByClient(Long userId, Long limit) {
        return beidouEventMapper.selectBeidouEventRankByClient(userId, limit);
    }
}
